<!DOCTYPE HTML>
<html lang="en">
<head>
<title>SetStoreCapslockMode - Syntax &amp; Usage | AutoHotkey</title>
<meta name="description" content="The SetStoreCapslockMode command determines whether to restore the state of the CapsLock key after a Send command." />
<meta name="ahk:equiv-v2" content="commands/SetStoreCapsLockMode.htm" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link href="../static/theme.css" rel="stylesheet" type="text/css" />
<script src="../static/content.js" type="text/javascript"></script>
</head>
<body>

<h1>SetStoreCapsLockMode</h1>

<p>Whether to restore the state of <kbd>CapsLock</kbd> after a <a href="Send.htm">Send</a>.</p>

<pre class="Syntax"><span class="func">SetStoreCapsLockMode</span>, OnOff</pre>
<h2>Parameters</h2>
<dl>

  <dt>OnOff</dt>
  <dd>
    <p>One of the following values:</p>
    <p><strong>On</strong>: This is the initial setting for all scripts: The <kbd>CapsLock</kbd> key will be restored to its former value if <a href="Send.htm">Send</a> needed to change it temporarily for its operation.</p>
    <p><strong>Off</strong>: The state of the <kbd>CapsLock</kbd> key is not changed at all. As a result, <a href="Send.htm">Send</a> will invert the case of the characters if <kbd>CapsLock</kbd> happens to be ON during the operation.</p>
    <p><span class="ver">[v1.1.30+]:</span> The decimal values 1 and 0 may be used in place of On and Off, respectively.</p>
  </dd>

</dl>

<h2>Remarks</h2>
<p>This means that the <kbd>CapsLock</kbd> key will not always be turned off for <a href="Send.htm">Send</a> and <a href="ControlSend.htm">ControlSend</a>. Even when it is successfully turned off, it might not get turned back on after the keys are sent.</p>
<p>This command is rarely used because the default behavior is best in most cases.</p>
<p>This setting is ignored by <a href="Send.htm#blind">blind mode</a> and (in <span class="ver">[v1.1.29+]</span>) <a href="Send.htm#SendText">text mode</a>; that is, the state of <kbd>CapsLock</kbd> is not changed in those cases.</p>
<p><span class="ver">[v1.1.23+]:</span> The built-in variable <strong>A_StoreCapsLockMode</strong> contains the current setting.</p>
<p>Every newly launched <a href="../misc/Threads.htm">thread</a> (such as a <a href="../Hotkeys.htm">hotkey</a>, <a href="Menu.htm">custom menu item</a>, or <a href="SetTimer.htm">timed</a> subroutine) starts off fresh with the default setting for this command. That default may be changed by using this command in the auto-execute section (top part of the script).</p>
<h2>Related</h2>
<p><a href="SetNumScrollCapsLockState.htm">SetCaps/Num/ScrollLockState</a>, <a href="Send.htm">Send</a>, <a href="ControlSend.htm">ControlSend</a></p>
<h2>Examples</h2>
<div class="ex" id="ExBasic">
<p><a href="#ExBasic">#1</a></p>
<pre>SetStoreCapsLockMode, Off</pre>
</div>

</body>
</html>
